<include file="__THEME__/header" />

<link href="../Public/css/Mess.css" rel="stylesheet" type="text/css" />
<link href="../Public/css/space.css" rel="stylesheet" type="text/css" />
<script>
function checkfrom(){
	if(!$.trim($('#ts_search_value').val())){
		$.tbox.no("{:L('no_target_selected')}","{:L('error')}");
		return false;
	}
	
	if($.trim($("input[name='subject']").val()).length<=5){
		$.tbox.no("{:L('no_less_than_5')}","{:L('error')}");
		return false;
	}
	
	if($.trim($("textarea[name='content']").val()).length==0){
		$.tbox.no("{:L('no_empty_content')}","{:L('error')}");
		return false;
	}		
	
	$("form[name='message_send']").submit();
}
</script>

<div class="contents lbg B"><include file="../Public/home_left" />
  <div class="contents_min w787">
  <h3 class="tit_h3">{:L('msg_center')}</h3>
    <div class="write_info">
      <div class="tab">
        <!-- 切换标签 begin  -->
        <ul>
           <li>
            <span><a href="{:U('home/message/index','type=notify')}">{:L('notify')}</a></span>
          </li>
          <li>
            <span><a href="{:U('home/message/index','type=inceptbox')}">{:L('inbox')}</a></span>
          </li>
          <li>
            <span><a href="{:U('home/message/index','type=sendbox')}">{:L('outbox')}</a></span>
          </li>
          <li  class="on">
            <span><a href="{:U('home/message/index','type=send')}">{:L('msg_write')}</a></span>
          </li>
        </ul>
      </div>
            <div style="width: 640px; padding-left:10px;" class="MList L base_input"><!-- 写短消息 begin  -->
            <h1 class="f12 mb10">{:L('msg_send')}</h1>
            <form action="index.php?mod=message&act=dosendmessage" method="post" name="message_send" >
                    <ul>
                    	<php>if($touid){</php>
	                        <li>
	                            <div style="width: 10%;" class="L alR">{:L('send_to')}：</div>
	                            <div style="width:90%;font-color:red;" class="L lh18">
	   								{$touid|getUserName}
									<input type="hidden" name="sendto_uids" id="ts_search_value" value="{$touid}">
	                            </div>
	                        </li>
						<php>}else{</php>
	                        <li>
	                            <div style="width:10%;" class="L alR lh25">{:L('send_to')}：</div>
	                            <div style="width:85%;" class="L">
	   								{:W('SearchUsers',array('class'=>'line lh25','name'=>'sendto','reg'=>true))}
	                            </div>
	                        </li>
						<php>}</php>
                        <li>
                            <div style="width: 10%;" class="L alR lh25">{:L('title')}：</div>
                            <div style="width: 85%;" class="L">
                                <input type="text" msg="{:L('title_limit')}" name="subject" style="width: 70%;" class="in_put"/>
                            </div>
                        </li>
                        <li>
                            <div style="width: 10%;" class="L lh18 alR lh25">{:L('content')}：</div>
                            <div style="width: 85%;" class="L"><textarea class="in_put"  name="content" cols="" rows="" style="width:99%; height:200px"></textarea>                           </div>
                        </li>
                         <li>
                          <div style="width: 10%;" class="L lh18 fB alR">&nbsp;</div>
                            <div style="width: 80%;" >
                                <input type="button" value="{:L('send')}" onclick="checkfrom()" class="btn_sea mr10"/>
                                <input type="button" value="{:L('cancel')}" class="btn_sea"/>
                            </div> 
                        </li>
                    </ul>
               </form>
            </div>
            <!-- 发短消息 end  -->
    </div>
  </div>
  <div class="C"></div>
</div>
<include file="__THEME__/footer" /> 